//
// Created by lxx on 23-1-11.
//

#ifndef SOLARENERGY_CHIER_MULTIPANELRECEIVER_CUH
#define SOLARENERGY_CHIER_MULTIPANELRECEIVER_CUH

#include "CudaReceiver.cuh"
#include <cmath>
#include <cstdio>
#include <iostream>

namespace solar::cuda
{
    class CudaMultiPanelReceiver : public CudaReceiver
    {
        public:
            __device__ __host__ CudaMultiPanelReceiver() = default;
            void CInit(float pixel_per_meter_for_receiver) override;
            void Cset_resolution(float pixel_per_meter_for_receiver) override;
            auto getFocusCenter(const float3& heliostat_position) -> float3 override;
            __device__ __host__ auto GIntersect(const float3& orig, const float3& dir, float& t,
                                                float& u, int& panel_no, int& tube_no) -> bool;

        private:
            __device__ __host__ auto isInsideCylinder(const float3& orig) -> bool;
    };
} // namespace solar::cuda

#if defined(SOLAR_CUDA_STANDALONE_COMPILE) && !defined(SOLAR_BUILD_CUDA_MULTI_PANEL_RECEIVER)
    #include "CudaMultiPanelReceiver.cu"
#endif

#endif // SOLARENERGY_CHIER_MULTIPANELRECEIVER_CUH
